package Ali;

import java.util.Scanner;

/**
 * @author zhangmin
 * @create 2022-04-21 14:37
 */
class Main0421{

    public static boolean isChar(char x){
        if((x<'a'||x>'z')&&(x<'A'||x>'Z')){
            return false;
        }
        return true;
    }
    public static boolean isDigit(char x){
        if(x<'0'||x>'9'){
            return false;
        }
        return true;
    }
    public static void main(String[] args){
        Scanner cin=new Scanner(System.in);
        int T=cin.nextInt();
        cin.nextLine();
        String[] lines=new String[T];
        for (int t = 0; t < T; t++) {
            lines[t]=cin.nextLine();
        }
        for(int t=0;t<T;t++){
            String name=lines[t];
            int len=name.length();
            if(len<5||len>20){
                System.out.println("Wrong");
                continue;
            }
            char firstchar=name.charAt(0);
            if((firstchar<'a'||firstchar>'z')&&(firstchar<'A'||firstchar>'Z')){
                System.out.println("Wrong");
                continue;
            }
            boolean hasDigit=false;
            int i=1;
            for(;i<len;i++){
                char c=name.charAt(i);
                if(!isChar(c)&&!isDigit(c)){
                    System.out.println("Wrong");
                    break;
                }
                if(isDigit(c)){
                    hasDigit=true;
                }
            }
            if(i<len){
                continue;
            }else{
                if(hasDigit){
                    System.out.println("Accept");
                }else{
                    System.out.println("Wrong");
                }
            }
        }
    }
}
